/**
 * Created by Administrator on 2016/9/2.
 */
$(document).ready(function(){
        postArray.u_id = u_id;
        postArray.headline_id = sessionStorage.headline_id;
        $.post(commonval+"/headline_comment_list",postArray,function(data){
            if(data.status == 1){
                var comment= new Vue({
                    el: '#hot',
                    data: {
                        items: data.data.hot_comment_list
                    }
                });
                var comment= new Vue({
                    el: '#new',
                    data: {
                        items: data.data.new_comment_list
                    }
                });
                $(".comment_title").css("display","block");
                //点赞逻辑
                $(".comment_img").click(function(){
                    $(this).attr('src','../images/praise_icon_l@2x.png');
                    var comment_id = $(this).attr('value');
                    var thumb_num = $(this).parent('p').children('.thumb_num');
                    var val= $(this).parent('p').children('.thumb_num').text();
                    sessionStorage.likeVall = parseInt(val)+1;
                    postArray.comment_id = comment_id;
                    $.post(commonval+"/headline_comment_zan",postArray,function(data){
                        if(data.status==1){
                            thumb_num.text(sessionStorage.likeVall);
                        }
                    })
                })
            }
        })


});